Get a list of client limits
This request is used to get a list of existing limits.
Request syntax
GET https://b2b-api.go.yandex.ru/integration/2.0/limits/search?
department_id=<department ID>
&limit=<number of records>
&offset=<number of records to skip>
&search=<search by name>
Request headers
Authorization: Bearer <OAuth-token>
OAuth access token. The steps to get a token are described in Getting started.
X-YaTaxi-Selected-Corp-Client-Id— client ID from the account. Required if multiple clients are available using the token.
Request parameters
The request may contain the following optional parameters:
-
limit: The number of records to print. If this parameter is omitted, information about the first 100 records is returned. -
offset: The number of records to skip. If this parameter is omitted, information starting from the first record is returned. -
search: An additional limit filter (by full match in thetitlefield)
Response field description
Responses may contain the following fields:
| Field | Description | Format |
|---|---|---|
items |
The list of cost centers. | Array |
limit |
The maximum number of records to return. | Number |
offset |
The number of records skipped. | Number |
total_amount |
The number of records found. | Number |
Structure of the items array element:
| Field | Description | Format |
|---|---|---|
id |
Limit ID. | String |
title |
The name of the limit. | String |
client_id |
Client ID. | String |
department_id |
ID of the department the limit applies to. If there is no department, it means this is the root department. | String |
categories |
The list of available service class categories. Specified only for the taxi and cargo services. List format: "category1","category2", .... |
Array of strings |
fuel_types |
The list of available fuel types. Specified only for the tanker service. List format: "type1","type2", .... |
Array of strings |
limits |
Limitations | Object |
geo_restrictions |
A block that contains information about unrestricted ride regions. | Array of objects |
time_restrictions |
A block that contains information about time restrictions. | Array of objects |
can_edit |
Indicates whether the user can change or remove this limit. | Boolean |
counters |
The number of employees with this limit. An object with the structure {"users": <number>}. |
Object |
is_default |
Indicates whether this limit is used by default (set when the service is activated for the client). | Boolean |
service |
ID of the service the limit is set for. | String |
travel_policy_id |
ID of the travel policy. | |
allow_reservations_without_approve |
Permission to book without approval. | |
approve_role |
A role for approval of the orders. | |
approve_roles |
A list of roles for approval of the orders. | |
is_qr_enabled |
Specifies whether it is allowed to pay by QR code in vendomats. |
Structure of the limits object:
|
Field |
Description |
Format |
|
|
A limit on the number of rides that the client can make during the period. Specified only for the |
Object |
|
|
A limit on the amount that the client can spend during the period. |
Object |
Structure of the geo_restrictions array element:
|
Field |
Description |
Format |
|
|
ID of the ride pickup region. |
String |
|
|
ID of the ride destination region. |
String |
Structure of the time_restrictions array element:
|
Field |
Description |
Format |
|
|
Restriction type. Acceptable values:
|
String |
|
|
Days of the week when ride orders are available. Acceptable values:
|
Array of strings |
|
|
The time when the order becomes available. Value format: |
String |
|
|
The time when the order will no longer be available. Value format: |
String |
Request example
GET https://b2b-api.go.yandex.ru/integration/2.0/limits/search?limit=100&offset=0&search=Taxi - 5000
...
Authorization: Bearer <OAuth token>
Response example
An example response to this request looks like this:
{
"items": [
{
"geo_restrictions": [
{
"source": "50d17034e0ebаааd952d2dad4bbbabcf",
"destination": "62b9160b33ааа4548e11bbb736bde8b"
}
],
"id": "9acfdf0a7c9a4dbb85c0601e422f25d9",
"client_id": "9acfdf0a7c9a4dbb85c0601e422f25d9",
"categories": [
"maybach",
"start",
"comfortplus",
"courier",
"child_tariff",
"express",
"cargo",
"vip",
"minivan",
"econom",
"business",
"premium_van"
],
"limits": {
"orders_amount": {
"value": 50,
"period": "month"
},
"orders_cost": {
"value": "5000",
"period": "month"
}
},
"title": "Taxi - 5000",
"time_restrictions": [
{
"type": "weekly_date",
"start_time": "00:59:00",
"end_time": "02:00:00",
"days": ["mo","tu","we","th","fr","sa","su"]
}
],
"can_edit": true,
"counters": {
"users": 3
},
"service": "taxi"
}
],
"limit": 100,
"offset": 0,
"total_amount": 1
}
Response codes
The response to this request may contain the following standard HTTP codes:
-
200: Request completed successfully. -
400: An unknown parameter or a parameter with an invalid value was passed in the request. -
401: The OAuth token is incorrect. -
403: The client doesn't have sufficient rights to run this request:-
SELECT_CLIENT_HEADER_REQUIRED: the request did not pass the header
X-YaTaxi-Selected-Corp-Client-Id(returned if more than one client is available for the token). -
SELECTED_CLIENT_ACCESS_DENIED: the header
X-YaTaxi-Selected-Corp-Client-Idcontains the client's ID, which this login does not have access to.
-